package com.aaa.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface T_AppraiserDao {
    @Select("<script>select a.id,a.number,a.password,a.name,a.pnumber,a.email,a.state,a.tid,b.tname" +
            " from appraiser a join appraiser_type b  ON  a.tid=b.id where 1=1 <if test=\"name!=null and name!=''\">" +
            " and a.name like concat('%',#{name},'%')</if>  " +
            "<if test=\"number!=null and number!=''\"> and a.number=#{number}</if>" +
            "limit #{start},#{pageSize}</script>")
    List<Map>   list(Map map);
    @Select("<script>select count(id) from appraiser  where 1=1 <if test=\"name!=null and name!=''\">" +
            " and name like concat('%',#{name},'%')</if></script>")
    Integer count(Map map);
    @Insert("insert into appraiser(number,password,name,pnumber,email,tid) values" +
            "(#{number},#{password},#{name},#{pnumber},#{email},#{tid})")
    Integer insert(Map map);
    @Update("update appraiser set number=#{number},password=#{password},name=#{name},pnumber=#{pnumber},email=#{email},tid=#{tid} where id=#{id}")
    Integer update(Map map);
    @Delete("delete from appraiser where id=#{id}")
    Integer del(Map map);
    @Select("select * from appraiser_type")
    List<Map> type();
    //修改人员评议状态
    @Update("update appraiser set state=1 where id=#{id}")
    Integer upstate(Integer id);
}
